#pragma once
// MESSAGE REMOTE_CONTROL_RECEIVE_STATUS PACKING

#define MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS 210


typedef struct __mavlink_remote_control_receive_status_t {
 uint64_t time_unix_usec; /*<  Timestamp (UNIX epoch time)*/
 uint16_t lock_lu_x; /*<  x1(int)*/
 uint16_t lock_lu_y; /*<  y1(int)*/
 uint16_t lock_rd_x; /*<  x2(int)*/
 uint16_t lock_rd_y; /*<  y2(int)*/
 int16_t gcu_yaw_speed; /*<  control gimbal gcu yaw speed*/
 int16_t gcu_pitch_speed; /*<  control gimbal gcu pitch speed*/
 uint8_t ai_status; /*<  ai_status 0:close, 1:open*/
 uint8_t fight_status; /*<  fight_status 0:close, 1:open*/
 uint8_t triger_status; /*<  triger close single tracking status*/
 uint8_t frame_count; /*<  lock frame count status*/
 uint8_t lock_id; /*<  lock obj id*/
 uint8_t back_center; /*<  control gimbal back to center*/
 uint8_t rcv1; /*<  rcv1 of the GCS this message*/
 uint8_t rcv2; /*<  rcv2 of the GCS this message*/
 uint8_t rcv3; /*<  rcv3 of the GCS this message*/
 uint8_t rcv4; /*<  rcv4 of the GCS this message*/
} mavlink_remote_control_receive_status_t;

#define MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN 30
#define MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_MIN_LEN 30
#define MAVLINK_MSG_ID_210_LEN 30
#define MAVLINK_MSG_ID_210_MIN_LEN 30

#define MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_CRC 157
#define MAVLINK_MSG_ID_210_CRC 157



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_REMOTE_CONTROL_RECEIVE_STATUS { \
    210, \
    "REMOTE_CONTROL_RECEIVE_STATUS", \
    17, \
    {  { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_remote_control_receive_status_t, time_unix_usec) }, \
         { "ai_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_remote_control_receive_status_t, ai_status) }, \
         { "fight_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_remote_control_receive_status_t, fight_status) }, \
         { "triger_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_remote_control_receive_status_t, triger_status) }, \
         { "frame_count", NULL, MAVLINK_TYPE_UINT8_T, 0, 23, offsetof(mavlink_remote_control_receive_status_t, frame_count) }, \
         { "lock_lu_x", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_remote_control_receive_status_t, lock_lu_x) }, \
         { "lock_lu_y", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_remote_control_receive_status_t, lock_lu_y) }, \
         { "lock_rd_x", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_remote_control_receive_status_t, lock_rd_x) }, \
         { "lock_rd_y", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_remote_control_receive_status_t, lock_rd_y) }, \
         { "lock_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_remote_control_receive_status_t, lock_id) }, \
         { "gcu_yaw_speed", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_remote_control_receive_status_t, gcu_yaw_speed) }, \
         { "gcu_pitch_speed", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_remote_control_receive_status_t, gcu_pitch_speed) }, \
         { "back_center", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_remote_control_receive_status_t, back_center) }, \
         { "rcv1", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_remote_control_receive_status_t, rcv1) }, \
         { "rcv2", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_remote_control_receive_status_t, rcv2) }, \
         { "rcv3", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_remote_control_receive_status_t, rcv3) }, \
         { "rcv4", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_remote_control_receive_status_t, rcv4) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_REMOTE_CONTROL_RECEIVE_STATUS { \
    "REMOTE_CONTROL_RECEIVE_STATUS", \
    17, \
    {  { "time_unix_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_remote_control_receive_status_t, time_unix_usec) }, \
         { "ai_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_remote_control_receive_status_t, ai_status) }, \
         { "fight_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_remote_control_receive_status_t, fight_status) }, \
         { "triger_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_remote_control_receive_status_t, triger_status) }, \
         { "frame_count", NULL, MAVLINK_TYPE_UINT8_T, 0, 23, offsetof(mavlink_remote_control_receive_status_t, frame_count) }, \
         { "lock_lu_x", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_remote_control_receive_status_t, lock_lu_x) }, \
         { "lock_lu_y", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_remote_control_receive_status_t, lock_lu_y) }, \
         { "lock_rd_x", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_remote_control_receive_status_t, lock_rd_x) }, \
         { "lock_rd_y", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_remote_control_receive_status_t, lock_rd_y) }, \
         { "lock_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_remote_control_receive_status_t, lock_id) }, \
         { "gcu_yaw_speed", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_remote_control_receive_status_t, gcu_yaw_speed) }, \
         { "gcu_pitch_speed", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_remote_control_receive_status_t, gcu_pitch_speed) }, \
         { "back_center", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_remote_control_receive_status_t, back_center) }, \
         { "rcv1", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_remote_control_receive_status_t, rcv1) }, \
         { "rcv2", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_remote_control_receive_status_t, rcv2) }, \
         { "rcv3", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_remote_control_receive_status_t, rcv3) }, \
         { "rcv4", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_remote_control_receive_status_t, rcv4) }, \
         } \
}
#endif

/**
 * @brief Pack a remote_control_receive_status message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param time_unix_usec  Timestamp (UNIX epoch time)
 * @param ai_status  ai_status 0:close, 1:open
 * @param fight_status  fight_status 0:close, 1:open
 * @param triger_status  triger close single tracking status
 * @param frame_count  lock frame count status
 * @param lock_lu_x  x1(int)
 * @param lock_lu_y  y1(int)
 * @param lock_rd_x  x2(int)
 * @param lock_rd_y  y2(int)
 * @param lock_id  lock obj id
 * @param gcu_yaw_speed  control gimbal gcu yaw speed
 * @param gcu_pitch_speed  control gimbal gcu pitch speed
 * @param back_center  control gimbal back to center
 * @param rcv1  rcv1 of the GCS this message
 * @param rcv2  rcv2 of the GCS this message
 * @param rcv3  rcv3 of the GCS this message
 * @param rcv4  rcv4 of the GCS this message
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_remote_control_receive_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               uint64_t time_unix_usec, uint8_t ai_status, uint8_t fight_status, uint8_t triger_status, uint8_t frame_count, uint16_t lock_lu_x, uint16_t lock_lu_y, uint16_t lock_rd_x, uint16_t lock_rd_y, uint8_t lock_id, int16_t gcu_yaw_speed, int16_t gcu_pitch_speed, uint8_t back_center, uint8_t rcv1, uint8_t rcv2, uint8_t rcv3, uint8_t rcv4)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN];
    _mav_put_uint64_t(buf, 0, time_unix_usec);
    _mav_put_uint16_t(buf, 8, lock_lu_x);
    _mav_put_uint16_t(buf, 10, lock_lu_y);
    _mav_put_uint16_t(buf, 12, lock_rd_x);
    _mav_put_uint16_t(buf, 14, lock_rd_y);
    _mav_put_int16_t(buf, 16, gcu_yaw_speed);
    _mav_put_int16_t(buf, 18, gcu_pitch_speed);
    _mav_put_uint8_t(buf, 20, ai_status);
    _mav_put_uint8_t(buf, 21, fight_status);
    _mav_put_uint8_t(buf, 22, triger_status);
    _mav_put_uint8_t(buf, 23, frame_count);
    _mav_put_uint8_t(buf, 24, lock_id);
    _mav_put_uint8_t(buf, 25, back_center);
    _mav_put_uint8_t(buf, 26, rcv1);
    _mav_put_uint8_t(buf, 27, rcv2);
    _mav_put_uint8_t(buf, 28, rcv3);
    _mav_put_uint8_t(buf, 29, rcv4);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN);
#else
    mavlink_remote_control_receive_status_t packet;
    packet.time_unix_usec = time_unix_usec;
    packet.lock_lu_x = lock_lu_x;
    packet.lock_lu_y = lock_lu_y;
    packet.lock_rd_x = lock_rd_x;
    packet.lock_rd_y = lock_rd_y;
    packet.gcu_yaw_speed = gcu_yaw_speed;
    packet.gcu_pitch_speed = gcu_pitch_speed;
    packet.ai_status = ai_status;
    packet.fight_status = fight_status;
    packet.triger_status = triger_status;
    packet.frame_count = frame_count;
    packet.lock_id = lock_id;
    packet.back_center = back_center;
    packet.rcv1 = rcv1;
    packet.rcv2 = rcv2;
    packet.rcv3 = rcv3;
    packet.rcv4 = rcv4;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_CRC);
}

/**
 * @brief Pack a remote_control_receive_status message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param status MAVLink status structure
 * @param msg The MAVLink message to compress the data into
 *
 * @param time_unix_usec  Timestamp (UNIX epoch time)
 * @param ai_status  ai_status 0:close, 1:open
 * @param fight_status  fight_status 0:close, 1:open
 * @param triger_status  triger close single tracking status
 * @param frame_count  lock frame count status
 * @param lock_lu_x  x1(int)
 * @param lock_lu_y  y1(int)
 * @param lock_rd_x  x2(int)
 * @param lock_rd_y  y2(int)
 * @param lock_id  lock obj id
 * @param gcu_yaw_speed  control gimbal gcu yaw speed
 * @param gcu_pitch_speed  control gimbal gcu pitch speed
 * @param back_center  control gimbal back to center
 * @param rcv1  rcv1 of the GCS this message
 * @param rcv2  rcv2 of the GCS this message
 * @param rcv3  rcv3 of the GCS this message
 * @param rcv4  rcv4 of the GCS this message
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_remote_control_receive_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
                               uint64_t time_unix_usec, uint8_t ai_status, uint8_t fight_status, uint8_t triger_status, uint8_t frame_count, uint16_t lock_lu_x, uint16_t lock_lu_y, uint16_t lock_rd_x, uint16_t lock_rd_y, uint8_t lock_id, int16_t gcu_yaw_speed, int16_t gcu_pitch_speed, uint8_t back_center, uint8_t rcv1, uint8_t rcv2, uint8_t rcv3, uint8_t rcv4)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN];
    _mav_put_uint64_t(buf, 0, time_unix_usec);
    _mav_put_uint16_t(buf, 8, lock_lu_x);
    _mav_put_uint16_t(buf, 10, lock_lu_y);
    _mav_put_uint16_t(buf, 12, lock_rd_x);
    _mav_put_uint16_t(buf, 14, lock_rd_y);
    _mav_put_int16_t(buf, 16, gcu_yaw_speed);
    _mav_put_int16_t(buf, 18, gcu_pitch_speed);
    _mav_put_uint8_t(buf, 20, ai_status);
    _mav_put_uint8_t(buf, 21, fight_status);
    _mav_put_uint8_t(buf, 22, triger_status);
    _mav_put_uint8_t(buf, 23, frame_count);
    _mav_put_uint8_t(buf, 24, lock_id);
    _mav_put_uint8_t(buf, 25, back_center);
    _mav_put_uint8_t(buf, 26, rcv1);
    _mav_put_uint8_t(buf, 27, rcv2);
    _mav_put_uint8_t(buf, 28, rcv3);
    _mav_put_uint8_t(buf, 29, rcv4);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN);
#else
    mavlink_remote_control_receive_status_t packet;
    packet.time_unix_usec = time_unix_usec;
    packet.lock_lu_x = lock_lu_x;
    packet.lock_lu_y = lock_lu_y;
    packet.lock_rd_x = lock_rd_x;
    packet.lock_rd_y = lock_rd_y;
    packet.gcu_yaw_speed = gcu_yaw_speed;
    packet.gcu_pitch_speed = gcu_pitch_speed;
    packet.ai_status = ai_status;
    packet.fight_status = fight_status;
    packet.triger_status = triger_status;
    packet.frame_count = frame_count;
    packet.lock_id = lock_id;
    packet.back_center = back_center;
    packet.rcv1 = rcv1;
    packet.rcv2 = rcv2;
    packet.rcv3 = rcv3;
    packet.rcv4 = rcv4;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS;
#if MAVLINK_CRC_EXTRA
    return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_CRC);
#else
    return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN);
#endif
}

/**
 * @brief Pack a remote_control_receive_status message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param time_unix_usec  Timestamp (UNIX epoch time)
 * @param ai_status  ai_status 0:close, 1:open
 * @param fight_status  fight_status 0:close, 1:open
 * @param triger_status  triger close single tracking status
 * @param frame_count  lock frame count status
 * @param lock_lu_x  x1(int)
 * @param lock_lu_y  y1(int)
 * @param lock_rd_x  x2(int)
 * @param lock_rd_y  y2(int)
 * @param lock_id  lock obj id
 * @param gcu_yaw_speed  control gimbal gcu yaw speed
 * @param gcu_pitch_speed  control gimbal gcu pitch speed
 * @param back_center  control gimbal back to center
 * @param rcv1  rcv1 of the GCS this message
 * @param rcv2  rcv2 of the GCS this message
 * @param rcv3  rcv3 of the GCS this message
 * @param rcv4  rcv4 of the GCS this message
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_remote_control_receive_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   uint64_t time_unix_usec,uint8_t ai_status,uint8_t fight_status,uint8_t triger_status,uint8_t frame_count,uint16_t lock_lu_x,uint16_t lock_lu_y,uint16_t lock_rd_x,uint16_t lock_rd_y,uint8_t lock_id,int16_t gcu_yaw_speed,int16_t gcu_pitch_speed,uint8_t back_center,uint8_t rcv1,uint8_t rcv2,uint8_t rcv3,uint8_t rcv4)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN];
    _mav_put_uint64_t(buf, 0, time_unix_usec);
    _mav_put_uint16_t(buf, 8, lock_lu_x);
    _mav_put_uint16_t(buf, 10, lock_lu_y);
    _mav_put_uint16_t(buf, 12, lock_rd_x);
    _mav_put_uint16_t(buf, 14, lock_rd_y);
    _mav_put_int16_t(buf, 16, gcu_yaw_speed);
    _mav_put_int16_t(buf, 18, gcu_pitch_speed);
    _mav_put_uint8_t(buf, 20, ai_status);
    _mav_put_uint8_t(buf, 21, fight_status);
    _mav_put_uint8_t(buf, 22, triger_status);
    _mav_put_uint8_t(buf, 23, frame_count);
    _mav_put_uint8_t(buf, 24, lock_id);
    _mav_put_uint8_t(buf, 25, back_center);
    _mav_put_uint8_t(buf, 26, rcv1);
    _mav_put_uint8_t(buf, 27, rcv2);
    _mav_put_uint8_t(buf, 28, rcv3);
    _mav_put_uint8_t(buf, 29, rcv4);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN);
#else
    mavlink_remote_control_receive_status_t packet;
    packet.time_unix_usec = time_unix_usec;
    packet.lock_lu_x = lock_lu_x;
    packet.lock_lu_y = lock_lu_y;
    packet.lock_rd_x = lock_rd_x;
    packet.lock_rd_y = lock_rd_y;
    packet.gcu_yaw_speed = gcu_yaw_speed;
    packet.gcu_pitch_speed = gcu_pitch_speed;
    packet.ai_status = ai_status;
    packet.fight_status = fight_status;
    packet.triger_status = triger_status;
    packet.frame_count = frame_count;
    packet.lock_id = lock_id;
    packet.back_center = back_center;
    packet.rcv1 = rcv1;
    packet.rcv2 = rcv2;
    packet.rcv3 = rcv3;
    packet.rcv4 = rcv4;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_CRC);
}

/**
 * @brief Encode a remote_control_receive_status struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param remote_control_receive_status C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_remote_control_receive_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_remote_control_receive_status_t* remote_control_receive_status)
{
    return mavlink_msg_remote_control_receive_status_pack(system_id, component_id, msg, remote_control_receive_status->time_unix_usec, remote_control_receive_status->ai_status, remote_control_receive_status->fight_status, remote_control_receive_status->triger_status, remote_control_receive_status->frame_count, remote_control_receive_status->lock_lu_x, remote_control_receive_status->lock_lu_y, remote_control_receive_status->lock_rd_x, remote_control_receive_status->lock_rd_y, remote_control_receive_status->lock_id, remote_control_receive_status->gcu_yaw_speed, remote_control_receive_status->gcu_pitch_speed, remote_control_receive_status->back_center, remote_control_receive_status->rcv1, remote_control_receive_status->rcv2, remote_control_receive_status->rcv3, remote_control_receive_status->rcv4);
}

/**
 * @brief Encode a remote_control_receive_status struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param remote_control_receive_status C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_remote_control_receive_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_remote_control_receive_status_t* remote_control_receive_status)
{
    return mavlink_msg_remote_control_receive_status_pack_chan(system_id, component_id, chan, msg, remote_control_receive_status->time_unix_usec, remote_control_receive_status->ai_status, remote_control_receive_status->fight_status, remote_control_receive_status->triger_status, remote_control_receive_status->frame_count, remote_control_receive_status->lock_lu_x, remote_control_receive_status->lock_lu_y, remote_control_receive_status->lock_rd_x, remote_control_receive_status->lock_rd_y, remote_control_receive_status->lock_id, remote_control_receive_status->gcu_yaw_speed, remote_control_receive_status->gcu_pitch_speed, remote_control_receive_status->back_center, remote_control_receive_status->rcv1, remote_control_receive_status->rcv2, remote_control_receive_status->rcv3, remote_control_receive_status->rcv4);
}

/**
 * @brief Encode a remote_control_receive_status struct with provided status structure
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param status MAVLink status structure
 * @param msg The MAVLink message to compress the data into
 * @param remote_control_receive_status C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_remote_control_receive_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_remote_control_receive_status_t* remote_control_receive_status)
{
    return mavlink_msg_remote_control_receive_status_pack_status(system_id, component_id, _status, msg,  remote_control_receive_status->time_unix_usec, remote_control_receive_status->ai_status, remote_control_receive_status->fight_status, remote_control_receive_status->triger_status, remote_control_receive_status->frame_count, remote_control_receive_status->lock_lu_x, remote_control_receive_status->lock_lu_y, remote_control_receive_status->lock_rd_x, remote_control_receive_status->lock_rd_y, remote_control_receive_status->lock_id, remote_control_receive_status->gcu_yaw_speed, remote_control_receive_status->gcu_pitch_speed, remote_control_receive_status->back_center, remote_control_receive_status->rcv1, remote_control_receive_status->rcv2, remote_control_receive_status->rcv3, remote_control_receive_status->rcv4);
}

/**
 * @brief Send a remote_control_receive_status message
 * @param chan MAVLink channel to send the message
 *
 * @param time_unix_usec  Timestamp (UNIX epoch time)
 * @param ai_status  ai_status 0:close, 1:open
 * @param fight_status  fight_status 0:close, 1:open
 * @param triger_status  triger close single tracking status
 * @param frame_count  lock frame count status
 * @param lock_lu_x  x1(int)
 * @param lock_lu_y  y1(int)
 * @param lock_rd_x  x2(int)
 * @param lock_rd_y  y2(int)
 * @param lock_id  lock obj id
 * @param gcu_yaw_speed  control gimbal gcu yaw speed
 * @param gcu_pitch_speed  control gimbal gcu pitch speed
 * @param back_center  control gimbal back to center
 * @param rcv1  rcv1 of the GCS this message
 * @param rcv2  rcv2 of the GCS this message
 * @param rcv3  rcv3 of the GCS this message
 * @param rcv4  rcv4 of the GCS this message
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_remote_control_receive_status_send(mavlink_channel_t chan, uint64_t time_unix_usec, uint8_t ai_status, uint8_t fight_status, uint8_t triger_status, uint8_t frame_count, uint16_t lock_lu_x, uint16_t lock_lu_y, uint16_t lock_rd_x, uint16_t lock_rd_y, uint8_t lock_id, int16_t gcu_yaw_speed, int16_t gcu_pitch_speed, uint8_t back_center, uint8_t rcv1, uint8_t rcv2, uint8_t rcv3, uint8_t rcv4)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN];
    _mav_put_uint64_t(buf, 0, time_unix_usec);
    _mav_put_uint16_t(buf, 8, lock_lu_x);
    _mav_put_uint16_t(buf, 10, lock_lu_y);
    _mav_put_uint16_t(buf, 12, lock_rd_x);
    _mav_put_uint16_t(buf, 14, lock_rd_y);
    _mav_put_int16_t(buf, 16, gcu_yaw_speed);
    _mav_put_int16_t(buf, 18, gcu_pitch_speed);
    _mav_put_uint8_t(buf, 20, ai_status);
    _mav_put_uint8_t(buf, 21, fight_status);
    _mav_put_uint8_t(buf, 22, triger_status);
    _mav_put_uint8_t(buf, 23, frame_count);
    _mav_put_uint8_t(buf, 24, lock_id);
    _mav_put_uint8_t(buf, 25, back_center);
    _mav_put_uint8_t(buf, 26, rcv1);
    _mav_put_uint8_t(buf, 27, rcv2);
    _mav_put_uint8_t(buf, 28, rcv3);
    _mav_put_uint8_t(buf, 29, rcv4);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS, buf, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_CRC);
#else
    mavlink_remote_control_receive_status_t packet;
    packet.time_unix_usec = time_unix_usec;
    packet.lock_lu_x = lock_lu_x;
    packet.lock_lu_y = lock_lu_y;
    packet.lock_rd_x = lock_rd_x;
    packet.lock_rd_y = lock_rd_y;
    packet.gcu_yaw_speed = gcu_yaw_speed;
    packet.gcu_pitch_speed = gcu_pitch_speed;
    packet.ai_status = ai_status;
    packet.fight_status = fight_status;
    packet.triger_status = triger_status;
    packet.frame_count = frame_count;
    packet.lock_id = lock_id;
    packet.back_center = back_center;
    packet.rcv1 = rcv1;
    packet.rcv2 = rcv2;
    packet.rcv3 = rcv3;
    packet.rcv4 = rcv4;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_CRC);
#endif
}

/**
 * @brief Send a remote_control_receive_status message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_remote_control_receive_status_send_struct(mavlink_channel_t chan, const mavlink_remote_control_receive_status_t* remote_control_receive_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_remote_control_receive_status_send(chan, remote_control_receive_status->time_unix_usec, remote_control_receive_status->ai_status, remote_control_receive_status->fight_status, remote_control_receive_status->triger_status, remote_control_receive_status->frame_count, remote_control_receive_status->lock_lu_x, remote_control_receive_status->lock_lu_y, remote_control_receive_status->lock_rd_x, remote_control_receive_status->lock_rd_y, remote_control_receive_status->lock_id, remote_control_receive_status->gcu_yaw_speed, remote_control_receive_status->gcu_pitch_speed, remote_control_receive_status->back_center, remote_control_receive_status->rcv1, remote_control_receive_status->rcv2, remote_control_receive_status->rcv3, remote_control_receive_status->rcv4);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS, (const char *)remote_control_receive_status, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_CRC);
#endif
}

#if MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This variant of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_remote_control_receive_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_unix_usec, uint8_t ai_status, uint8_t fight_status, uint8_t triger_status, uint8_t frame_count, uint16_t lock_lu_x, uint16_t lock_lu_y, uint16_t lock_rd_x, uint16_t lock_rd_y, uint8_t lock_id, int16_t gcu_yaw_speed, int16_t gcu_pitch_speed, uint8_t back_center, uint8_t rcv1, uint8_t rcv2, uint8_t rcv3, uint8_t rcv4)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_uint64_t(buf, 0, time_unix_usec);
    _mav_put_uint16_t(buf, 8, lock_lu_x);
    _mav_put_uint16_t(buf, 10, lock_lu_y);
    _mav_put_uint16_t(buf, 12, lock_rd_x);
    _mav_put_uint16_t(buf, 14, lock_rd_y);
    _mav_put_int16_t(buf, 16, gcu_yaw_speed);
    _mav_put_int16_t(buf, 18, gcu_pitch_speed);
    _mav_put_uint8_t(buf, 20, ai_status);
    _mav_put_uint8_t(buf, 21, fight_status);
    _mav_put_uint8_t(buf, 22, triger_status);
    _mav_put_uint8_t(buf, 23, frame_count);
    _mav_put_uint8_t(buf, 24, lock_id);
    _mav_put_uint8_t(buf, 25, back_center);
    _mav_put_uint8_t(buf, 26, rcv1);
    _mav_put_uint8_t(buf, 27, rcv2);
    _mav_put_uint8_t(buf, 28, rcv3);
    _mav_put_uint8_t(buf, 29, rcv4);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS, buf, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_CRC);
#else
    mavlink_remote_control_receive_status_t *packet = (mavlink_remote_control_receive_status_t *)msgbuf;
    packet->time_unix_usec = time_unix_usec;
    packet->lock_lu_x = lock_lu_x;
    packet->lock_lu_y = lock_lu_y;
    packet->lock_rd_x = lock_rd_x;
    packet->lock_rd_y = lock_rd_y;
    packet->gcu_yaw_speed = gcu_yaw_speed;
    packet->gcu_pitch_speed = gcu_pitch_speed;
    packet->ai_status = ai_status;
    packet->fight_status = fight_status;
    packet->triger_status = triger_status;
    packet->frame_count = frame_count;
    packet->lock_id = lock_id;
    packet->back_center = back_center;
    packet->rcv1 = rcv1;
    packet->rcv2 = rcv2;
    packet->rcv3 = rcv3;
    packet->rcv4 = rcv4;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS, (const char *)packet, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_MIN_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_CRC);
#endif
}
#endif

#endif

// MESSAGE REMOTE_CONTROL_RECEIVE_STATUS UNPACKING


/**
 * @brief Get field time_unix_usec from remote_control_receive_status message
 *
 * @return  Timestamp (UNIX epoch time)
 */
static inline uint64_t mavlink_msg_remote_control_receive_status_get_time_unix_usec(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint64_t(msg,  0);
}

/**
 * @brief Get field ai_status from remote_control_receive_status message
 *
 * @return  ai_status 0:close, 1:open
 */
static inline uint8_t mavlink_msg_remote_control_receive_status_get_ai_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  20);
}

/**
 * @brief Get field fight_status from remote_control_receive_status message
 *
 * @return  fight_status 0:close, 1:open
 */
static inline uint8_t mavlink_msg_remote_control_receive_status_get_fight_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  21);
}

/**
 * @brief Get field triger_status from remote_control_receive_status message
 *
 * @return  triger close single tracking status
 */
static inline uint8_t mavlink_msg_remote_control_receive_status_get_triger_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  22);
}

/**
 * @brief Get field frame_count from remote_control_receive_status message
 *
 * @return  lock frame count status
 */
static inline uint8_t mavlink_msg_remote_control_receive_status_get_frame_count(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  23);
}

/**
 * @brief Get field lock_lu_x from remote_control_receive_status message
 *
 * @return  x1(int)
 */
static inline uint16_t mavlink_msg_remote_control_receive_status_get_lock_lu_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint16_t(msg,  8);
}

/**
 * @brief Get field lock_lu_y from remote_control_receive_status message
 *
 * @return  y1(int)
 */
static inline uint16_t mavlink_msg_remote_control_receive_status_get_lock_lu_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint16_t(msg,  10);
}

/**
 * @brief Get field lock_rd_x from remote_control_receive_status message
 *
 * @return  x2(int)
 */
static inline uint16_t mavlink_msg_remote_control_receive_status_get_lock_rd_x(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint16_t(msg,  12);
}

/**
 * @brief Get field lock_rd_y from remote_control_receive_status message
 *
 * @return  y2(int)
 */
static inline uint16_t mavlink_msg_remote_control_receive_status_get_lock_rd_y(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint16_t(msg,  14);
}

/**
 * @brief Get field lock_id from remote_control_receive_status message
 *
 * @return  lock obj id
 */
static inline uint8_t mavlink_msg_remote_control_receive_status_get_lock_id(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  24);
}

/**
 * @brief Get field gcu_yaw_speed from remote_control_receive_status message
 *
 * @return  control gimbal gcu yaw speed
 */
static inline int16_t mavlink_msg_remote_control_receive_status_get_gcu_yaw_speed(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  16);
}

/**
 * @brief Get field gcu_pitch_speed from remote_control_receive_status message
 *
 * @return  control gimbal gcu pitch speed
 */
static inline int16_t mavlink_msg_remote_control_receive_status_get_gcu_pitch_speed(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  18);
}

/**
 * @brief Get field back_center from remote_control_receive_status message
 *
 * @return  control gimbal back to center
 */
static inline uint8_t mavlink_msg_remote_control_receive_status_get_back_center(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  25);
}

/**
 * @brief Get field rcv1 from remote_control_receive_status message
 *
 * @return  rcv1 of the GCS this message
 */
static inline uint8_t mavlink_msg_remote_control_receive_status_get_rcv1(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  26);
}

/**
 * @brief Get field rcv2 from remote_control_receive_status message
 *
 * @return  rcv2 of the GCS this message
 */
static inline uint8_t mavlink_msg_remote_control_receive_status_get_rcv2(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  27);
}

/**
 * @brief Get field rcv3 from remote_control_receive_status message
 *
 * @return  rcv3 of the GCS this message
 */
static inline uint8_t mavlink_msg_remote_control_receive_status_get_rcv3(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  28);
}

/**
 * @brief Get field rcv4 from remote_control_receive_status message
 *
 * @return  rcv4 of the GCS this message
 */
static inline uint8_t mavlink_msg_remote_control_receive_status_get_rcv4(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  29);
}

/**
 * @brief Decode a remote_control_receive_status message into a struct
 *
 * @param msg The message to decode
 * @param remote_control_receive_status C-struct to decode the message contents into
 */
static inline void mavlink_msg_remote_control_receive_status_decode(const mavlink_message_t* msg, mavlink_remote_control_receive_status_t* remote_control_receive_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    remote_control_receive_status->time_unix_usec = mavlink_msg_remote_control_receive_status_get_time_unix_usec(msg);
    remote_control_receive_status->lock_lu_x = mavlink_msg_remote_control_receive_status_get_lock_lu_x(msg);
    remote_control_receive_status->lock_lu_y = mavlink_msg_remote_control_receive_status_get_lock_lu_y(msg);
    remote_control_receive_status->lock_rd_x = mavlink_msg_remote_control_receive_status_get_lock_rd_x(msg);
    remote_control_receive_status->lock_rd_y = mavlink_msg_remote_control_receive_status_get_lock_rd_y(msg);
    remote_control_receive_status->gcu_yaw_speed = mavlink_msg_remote_control_receive_status_get_gcu_yaw_speed(msg);
    remote_control_receive_status->gcu_pitch_speed = mavlink_msg_remote_control_receive_status_get_gcu_pitch_speed(msg);
    remote_control_receive_status->ai_status = mavlink_msg_remote_control_receive_status_get_ai_status(msg);
    remote_control_receive_status->fight_status = mavlink_msg_remote_control_receive_status_get_fight_status(msg);
    remote_control_receive_status->triger_status = mavlink_msg_remote_control_receive_status_get_triger_status(msg);
    remote_control_receive_status->frame_count = mavlink_msg_remote_control_receive_status_get_frame_count(msg);
    remote_control_receive_status->lock_id = mavlink_msg_remote_control_receive_status_get_lock_id(msg);
    remote_control_receive_status->back_center = mavlink_msg_remote_control_receive_status_get_back_center(msg);
    remote_control_receive_status->rcv1 = mavlink_msg_remote_control_receive_status_get_rcv1(msg);
    remote_control_receive_status->rcv2 = mavlink_msg_remote_control_receive_status_get_rcv2(msg);
    remote_control_receive_status->rcv3 = mavlink_msg_remote_control_receive_status_get_rcv3(msg);
    remote_control_receive_status->rcv4 = mavlink_msg_remote_control_receive_status_get_rcv4(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN? msg->len : MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN;
        memset(remote_control_receive_status, 0, MAVLINK_MSG_ID_REMOTE_CONTROL_RECEIVE_STATUS_LEN);
    memcpy(remote_control_receive_status, _MAV_PAYLOAD(msg), len);
#endif
}
